package com.lening.provider.controller.OwnersRepair;

import com.lening.common.base.BaseController;
import com.lening.provider.dto.OwnersRepair.RepairTypeDTO;
import com.lening.provider.po.OwnersRepair.RepairTypePO;
import com.lening.provider.service.OwnersRepair.RepairTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 刘政华
 * @datetime 2024/6/5 11:57
 * @description 类对象
 */
@Slf4j
@RestController
@RequestMapping("repairTypes")
public class RepairTypeController extends BaseController<RepairTypePO, RepairTypeDTO, RepairTypeService> {

    @Resource
    private RepairTypeService repairTypeService;

    @GetMapping("dropdown")
    public List<RepairTypeDTO> getNewList(@RequestParam(name = "repairType", required = false) String repairType){
        List<RepairTypeDTO> list = repairTypeService.getByName(repairType);
        return list;
    }

    //repair_type

}
